package com.hadoop.rpc.service.publish;


import com.hadoop.rpc.service.LoginService;
import com.hadoop.rpc.service.impl.LoginServiceImpl;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.ipc.RPC;

import java.io.IOException;

/**
 * Created by LiuChang on 2017/10/19/019.
 */
public class ServicePublisher {
    public static void main(String[] args) throws IOException {
        Configuration configuration = new Configuration();
        RPC.Builder builder = new RPC.Builder(configuration);

        builder.setBindAddress("localhost")
                .setPort(10000)
                .setProtocol(LoginService.class)
                .setInstance(new LoginServiceImpl());


        RPC.Server server = builder.build();
        server.start();
    }
}
